#ifndef __LOG_H__
#define __LOG_H__


#include <stdarg.h>
#include "SEGGER_RTT.h"
#include <stdint.h>

#define  NULL        0

void log_printl(uint8_t on, const char * sFormat, ...);
void log_printf(uint8_t on, const char * sFormat, ...);
void log_array(uint8_t on, char* start,char *end,uint8_t * data, uint32_t len);

#if(LOG_TYPE == LOG_OFF)
  
    #define log_line(fmt,...)  
    #define log(fmt, ...)  

#elif(LOG_TYPE == LOG_ON_SEG)

    #define log_line(fmt,...)        SEGGER_RTT_SetTerminal(0);\
                                            SEGGER_RTT_printf(0, fmt, ##__VA_ARGS__);\
                                            SEGGER_RTT_printf(0,"\r\n");
    
    #define log(fmt, ...)             SEGGER_RTT_SetTerminal(0);\
                                            SEGGER_RTT_printf(0, fmt, ##__VA_ARGS__);
#endif

#endif
